<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div class="multidimensional">
			4564654
		</div>
		<!-- 直接引入html2pdf -->
		<script src="./lib/js/html2pdf.bundle.js"></script>
		<script>
			//使用DOM操作获取到要存为PDF的元素
			var element = document.getElementsByClassName("multidimensional")[0];
			//配置PDF的参数，详细配置见文档
			var opt = {
				margin: 0.3,
				filename: "name.pdf",
				image: { type: "jpeg", quality: 1 },
				html2canvas: { scale: 2 },
				jsPDF: { unit: "mm", format: [1240, 1500], orientation: "portrait" },
			};
			//存为PDF
			html2pdf().set(opt).from(element).save();
		</script>
	</body>
</html>